package com.lyk.read.book.ui.main

import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lyk.common.manager.GlideManager
import com.lyk.read.book.R
import com.lyk.read.book.bean.ItemBean

/**
 * Created by LianYongKe on 2024/3/13.
 */
class MainAdapter(list: MutableList<ItemBean>):
    BaseQuickAdapter<ItemBean, BaseViewHolder>(R.layout.item_main, list) {


    override fun convert(holder: BaseViewHolder, item: ItemBean) {
        holder.setText(R.id.main_item_title, item.title)
        holder.setText(R.id.main_item_desc, item.desc)

        val image = holder.getView<ImageView>(R.id.main_item_img)
        GlideManager.loadGalleyImage(image.context, image, item.img)
    }


}